package cn.minimelon.solon.mapper.clear;

import cn.minimelon.solon.domain.system.FusionInvoiceDetail;
import cn.minimelon.solon.domain.system.FusionOutBalanceDetail;
import org.beetl.sql.mapper.annotation.Param;
import org.beetl.sql.mapper.annotation.Template;

import java.util.List;

public interface FusionReportMapper {
    @Template("select id, detail_id from fusion_invoice_detail where invoicing_time < #{yearAgo} limit 50000")
    List<FusionInvoiceDetail> queryInvoiceDetail(@Param("yearAgo") String yearAgo);

    @Template("delete from fusion_invoice_detail where id in ( #{join(ids)} )")
    void deleteInvoiceDetail(@Param("ids") List<String> ids);

    @Template("select id from fusion_out_balance_detail where invoicing_time < #{yearAgo} limit 10000")
    List<FusionOutBalanceDetail> queryBalanceDetail(String yearAgo);

    @Template("delete from fusion_out_balance_detail where id in ( #{join(ids)} )")
    int deleteBalanceDetail(@Param("ids") List<String> ids);
}
